# makefile for iteration 1

all: driver
	
driver.o :driver.cpp 
	g++ -c driver.cpp  -o driver.o

game.o: Game.cpp Game.h
	g++ -c Game.cpp -o game.o
team.o: Team.cpp Team.h
	g++ -c Team.cpp -o team.o
time.o: Time.cpp Time.h
	g++ -c Time.cpp -o time.o
player.o: Player.cpp Player.h
	g++ -c Player.cpp -o player.o 
shot.o: Shot.cpp Shot.h
	g++ -c Shot.cpp -o shot.o
event.o: Event.cpp Event.h
	g++ -c Event.cpp -o event.o
foul.o: Foul.cpp Foul.h
	g++ -c Foul.cpp -o foul.o
violation.o: Violation.cpp
	g++ -c Violation.cpp -o violation.o
rebound.o: Rebound.cpp Rebound.h
	g++ -c Rebound.cpp -o rebound.o
steal.o: Steal.cpp Steal.h
	g++ -c Steal.cpp -o steal.o
timeout.o: Timeout.cpp Timeout.h
	g++ -c Timeout.cpp -o timeout.o
jumpball.o: Jumpball.cpp Jumpball.h
	g++ -c Jumpball.cpp -o jumpball.o
newlineup.o: Newlineup.cpp Newlineup.h
	g++ -c Newlineup.cpp -o newlineup.o
jumboTron.o: JumboTron.cpp
	g++ -c JumboTron.cpp -o jumboTron.o 

tests: test_exe
	./test_exe

black_test: driver.cpp
	cat Data1.txt | driver -> data1output.txt
	cat Data2.txt | driver -> data2output.txt
	@echo Warning! Any differences below are likely errors that should be investigated. 
	diff ExpectedData1.txt data1output.txt 
	diff ExpectedData2.txt data2output.txt

Test_All.cpp: Iteration2Tester.h
	perl ../lib/cxxtest/cxxtestgen.pl --error-printer Iteration2Tester.h -o Test_All.cpp
	

test_exe: test_all.o game.o team.o shot.o time.o player.o event.o foul.o violation.o rebound.o steal.o timeout.o newlineup.o jumpball.o
	g++ -o test_exe test_all.o game.o team.o shot.o time.o player.o event.o foul.o violation.o rebound.o steal.o timeout.o newlineup.o jumpball.o

test_all.o: Test_All.cpp
	g++ -I../lib/cxxtest -c Test_All.cpp -o test_all.o

driver: game.o team.o shot.o time.o driver.o player.o event.o foul.o violation.o rebound.o steal.o timeout.o newlineup.o jumpball.o
	g++ game.o team.o shot.o time.o driver.o player.o event.o foul.o violation.o rebound.o steal.o timeout.o newlineup.o jumpball.o -o driver
clean: 
	rm -f *.o
	rm -f driver
	rm -f Test_All.cpp
	rm -f test_exe 
	rm -f data1out*
	rm -f data2out*	
